package mapproviderapi;

import java.util.ArrayList;
import java.util.List;

public class GoogleStaticMapProvider extends MapProvider {

	protected final static String SERVER_URL = "http://maps.googleapis.com/maps/api/staticmap?center=";
	
	public GoogleStaticMapProvider(int mapWidth, int mapHeight) {
		super(mapWidth, mapHeight);
		tileWidth = mapWidth;
		tileHeight = mapHeight;
	}

	@Override
	public List<MapTile> getMapTiles(Coordinate center, int zoom) {
		MapTile mapTile = new MapTile();
		mapTile.setCoordinate(center);
		mapTile.setTileHeight(tileHeight);
		mapTile.setTileWidth(tileWidth);
		mapTile.setZoom(zoom);
		String tileUrl = SERVER_URL.concat(String.valueOf(center.toString())).concat("&zoom=").
						concat(String.valueOf(zoom)).concat("&sensor=true");
		mapTile.setTileUrl(tileUrl);
		
		List<MapTile> listMapTile = new ArrayList<MapTile>();
		listMapTile.add(mapTile);
		return listMapTile;
	}

}
